package com.nidu.demo.log;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import com.nidu.demo.log.api.SysOperateLogService;
import com.nidu.demo.log.dto.*;
import com.nidu.demo.log.executor.command.OperateLogDeleteCmdExe;
import com.nidu.demo.log.executor.query.*;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Set;

/**
 * 操作日志服务实现类
 *
 * @author auto
 */
@Service
@RequiredArgsConstructor
public class SysOperateLogServiceImpl implements SysOperateLogService {

    private final OperateLogSingleQryExe singleQryExe;
    private final OperateLogPageQryExe pageQryExe;
    private final OperateLogDeleteCmdExe deleteCmdExe;

    @Override
    public SingleResponse<OperateLogCO> getById(Long id) {
        return singleQryExe.execute(id);
    }

    @Override
    public PageResponse<OperateLogCO> page(OperateLogPageQry qry) {
        return pageQryExe.execute(qry);
    }

    @Override
    public Response delete(Long id) {
        return deleteCmdExe.execute(id);
    }

    @Override
    public Response delete(Set<Long> ids) {
        return deleteCmdExe.execute(ids);
    }

    @Override
    public Response clear() {
        return deleteCmdExe.execute();
    }

    @Override
    public Response export(OperateLogPageQry qry) {
        return null;
    }

}
